<template>
	<view style='height: 100%;'>
		<navbar title="报名填写" :back="true" color="#fff" leftIconColor="#fff"></navbar>
		<view class="conter">
			 <view style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;">
			 	<view style="display: flex;padding-bottom: 20rpx;border-bottom: 2rpx solid #f2f2f2;" @click="goCard(`/pages/sub/store/detail?id=${details.id}`)">
			 		<image :src="details.image" mode="" style="width: 220rpx;height:220rpx;border-radius: 12rpx;"></image>
			 		<view style="margin-left:20rpx;">
			 			<view style="margin-bottom: 20rpx;color:#000;font-size: 28rpx;font-weight: 650;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;width:380rpx;">{{details.name}}</view>
			 			<view style="display: flex;align-items: center;">
			 				<view style="color:#848484;font-size: 24rpx;">开始时间 :</view>
			 				<view style="padding-left:10rpx;color:#848484;font-size: 22rpx;">{{details.beginTime}}</view>
			 			</view>
			 			<view style="display: flex;align-items: center;margin-top: 20rpx;">
			 				<view style="color:#848484;font-size: 24rpx;">结束时间 :</view>
			 				<view style="padding-left:10rpx;color:#848484;font-size: 22rpx;">{{details.endTime}}</view>
			 			</view>
			 		    <view style="display: flex;margin-top: 20rpx;">
							<view style="color:#848484;font-size: 24rpx;margin-right: 10rpx;">报名人数 :</view>
			 		    	<view style="color: #fdc066;font-size: 22rpx;background-color: #feeed6;padding: 10rpx;width:160rpx;border-radius: 10rpx;text-align: center;margin: 8rpx 0;" v-if="details.drPeople-details.drMakeNum>0&&details.drPeople-details.drMakeNum<=30&type=='达人'">仅剩{{details.drMakeNum - details.drPeople}}位名额</view>
			 				<view style="color: #fdc066;font-size: 22rpx;background-color: #feeed6;padding: 10rpx;width:160rpx;border-radius: 10rpx;text-align: center;margin: 8rpx 0;" v-if="details.jgPeople-details.jgMakeNum>0&&details.jgPeople-details.jgMakeNum<=30&type=='机构'">仅剩{{details.jgMakeNum - details.jgPeople}}位名额</view>
							<view style="color: #fdc066;font-size: 22rpx;background-color: #feeed6;padding: 10rpx;width:160rpx;border-radius: 10rpx;text-align: center;margin: 8rpx 0;" v-if="details.sjPeople-details.sjMakeNum>0&&details.sjPeople-details.sjMakeNum<=30&type=='商家'">仅剩{{details.sjMakeNum - details.sjPeople}}位名额</view>
			 		        <view style="color: #fdc066;font-size: 22rpx;background-color: #feeed6;padding: 10rpx;width:160rpx;border-radius: 10rpx;text-align: center;margin: 8rpx 0;" v-if="details.tzPeople-details.tzMakeNum>0&&details.tzPeople-details.tzMakeNum<=30&type=='商家'">仅剩{{details.tzMakeNum - details.tzPeople}}位名额</view>
						    <view style="display: flex;align-items: center;margin-left: 10rpx;" v-if="type=='达人'">
							   <view style="font-size: 24rpx;color:#75a3fd;">{{details.drMakeNum}}</view>
							   <view style="font-size: 24rpx;color: #a9a9a9;">/{{details.drPeople}}</view>
						    </view>
							<view style="display: flex;align-items: center;margin-left: 10rpx;" v-if="type=='商家'">
							   <view style="font-size: 24rpx;color:#75a3fd;">{{details.sjMakeNum}}</view>
							   <view style="font-size: 24rpx;color: #a9a9a9;">/{{details.sjPeople}}</view>
							</view>
							<view style="display: flex;align-items: center;margin-left: 10rpx;" v-if="type=='机构'">
							   <view style="font-size: 24rpx;color:#75a3fd;">{{details.jgMakeNum}}</view>
							   <view style="font-size: 24rpx;color: #a9a9a9;">/{{details.jgPeople}}</view>
							</view>
							<view style="display: flex;align-items: center;margin-left:10rpx;" v-if="type=='团长'">
							   <view style="font-size: 24rpx;color:#75a3fd;">{{details.tzMakeNum}}</view>
							   <view style="font-size: 24rpx;color: #a9a9a9;">/{{details.tzPeople}}</view>
							</view>
						</view>
			 		</view>
			 	</view>
			 	 <view style="padding-top: 20rpx;display: flex;align-items: center;" @click="openMap(details)">
			 		 <u-icon name="map" color="#9d9d9d" size="22"></u-icon>
			 		 <view style="font-size: 24rpx;color: #9d9d9d;margin-left: 10rpx;">{{details.city+details.district+details.address}}</view>
			 	 </view>
			 </view>
			 <view style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;">
				 <view style="display: flex;justify-content: space-between;align-items: center;padding-bottom: 20rpx;border-bottom: 2rpx solid #f2f2f2;">
					 <view style="font-size: 28rpx;font-weight: 650;">身份类型</view>
					 <view style='display: flex;align-items: center;' @click='proShow=true'>
						 <u-input placeholder="请选择身份类型" border="none" disabled v-model="type" inputAlign='right' disabledColor='transparent' placeholderStyle='color:#000;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
						 <view style="margin-left: 10rpx;">
							 <u-icon name="arrow-right" color="#000" size="14"></u-icon>
						 </view>
					 </view>
				 </view>
				 <view style="display: flex;justify-content: space-between;align-items: center;padding-top: 20rpx;">
					 <view style="font-size: 28rpx;font-weight: 650;">行业类别</view>
					 <view style='display: flex;align-items: center;'@click='getTypeShow()'>
						 <u-input placeholder="请选择行业类别" border="none" disabled v-model="leim" inputAlign='right' disabledColor='transparent' placeholderStyle='color:#000;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
						 <view style="margin-left: 10rpx;">
							 <u-icon name="arrow-right" color="#000" size="14"></u-icon>
						 </view>
					 </view>
				 </view>
			 </view>
			 <view style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;" v-if="type=='达人'">
			       <view style="display: flex;align-items: center;padding-bottom: 20rpx;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">姓名</view>
						 <u-input placeholder="请输入姓名" border="none" v-model="darn.name" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
			       </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">手机号码</view>
						 <u-input placeholder="请输入手机号码" border="none" v-model="darn.phone" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">参加人数</view>
						 <u-input placeholder="请输入参加人数" border="none" v-model="darn.people" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				  <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">账号名称</view>
						 <u-input placeholder="请输入达人账号名称" border="none" v-model="darn.accountName" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding-top: 20rpx;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">UID</view>
						 <u-input placeholder="请输入UID" border="none" v-model="darn.uuid" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				         <view style="display: flex;align-items: center;" @click="previewImg()">
							 <view style="font-size: 22rpx;color:#bdbdbd;margin-right: 10rpx;">如何获取UID</view>
							 <u-icon name="question-circle" color="#bdbdbd" size="11"></u-icon>
						 </view>
				   </view>
			 </view>
			 <view style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;" v-if="type=='商家'">
			       <view style="display: flex;align-items: center;padding-bottom: 20rpx;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">姓名</view>
						 <u-input placeholder="请输入姓名" border="none" v-model="sj.name" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
			       </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">手机号码</view>
						 <u-input placeholder="请输入手机号码" border="none" v-model="sj.phone" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">参加人数</view>
						 <u-input placeholder="请输入参加人数" border="none" v-model="sj.people" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				 <!--  <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">邀约人</view>
						 <u-input placeholder="请输入邀约人" border="none" v-model="sj.official" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view> -->
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">品牌名称</view>
						 <u-input placeholder="请输入品牌名称" border="none" v-model="sj.brand" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">店铺名称</view>
						 <u-input placeholder="请输入店铺名称" border="none" v-model="sj.shop" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding-top:20rpx;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">店铺短ID</view>
						 <u-input placeholder="请输入店铺短ID" border="none" v-model="sj.shopId" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
			 </view>
			 <view style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;" v-if="type=='团长'">
			       <view style="display: flex;align-items: center;padding-bottom: 20rpx;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">姓名</view>
						 <u-input placeholder="请输入姓名" border="none" v-model="tuan.name" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
			       </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">手机号码</view>
						 <u-input placeholder="请输入手机号码" border="none" v-model="tuan.phone" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">参加人数</view>
						 <u-input placeholder="请输入参加人数" border="none" v-model="tuan.people" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				<!--   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">邀约人</view>
						 <u-input placeholder="请输入邀约人" border="none" v-model="tuan.official" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view> -->
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">团长名称</view>
						 <u-input placeholder="请输入品牌名称" border="none" v-model="tuan.teamName" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding-top:20rpx;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">团长等级</view>
						 <view @click='leShow=true'>
							 <u-input placeholder="请选择团长等级" border="none" v-model="tuan.teamLevel" disabled disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
						 </view>
				   </view>
			 </view>
			 <view style="background-color: #fff;border-radius: 20rpx;padding: 20rpx;margin-top: 20rpx;" v-if="type=='机构'">
			       <view style="display: flex;align-items: center;padding-bottom: 20rpx;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">姓名</view>
						 <u-input placeholder="请输入姓名" border="none" v-model="jg.name" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
			       </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">手机号码</view>
						 <u-input placeholder="请输入手机号码" border="none" v-model="jg.phone" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				   <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">参加人数</view>
						 <u-input placeholder="请输入参加人数" border="none" v-model="jg.people" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
				 <!--  <view style="display: flex;align-items: center;padding:20rpx 0;border-bottom: 2rpx solid #f2f2f2;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">邀约人</view>
						 <u-input placeholder="请输入邀约人" border="none" v-model="jg.official" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view> -->
				   <view style="display: flex;align-items: center;padding-top:20rpx;">
						 <view style="font-size: 28rpx;font-weight: 650;margin-right: 60rpx;margin-bottom: 5rpx;width: 120rpx;text-align: justify; text-align-last: justify;">机构名称</view>
						 <u-input placeholder="请输入机构名称" border="none" v-model="jg.mechanismName" disabledColor='transparent' placeholderStyle='color:#bdbdbd;font-size: 28rpx'  color='#000' fontSize='14px'></u-input>
				   </view>
			 </view>
			<pxingPicker ref='pickerName' :deepLength='1' :chooseList='typeList' :defaultChooseList='[0]' @colse='colse'  @confirm='Typeconfirm'></pxingPicker>
			<u-picker :show="proShow" :columns="proList" :closeOnClickOverlay='true' keyName='text' @close='proShow=false' @confirm='proConfirm' @cancel='proShow=false'></u-picker>
			<u-picker :show="leShow" :columns="level" :closeOnClickOverlay='true' keyName='text' @close='leShow=false' @confirm='leConfirm' @cancel='leShow=false'></u-picker>
			<view style="padding: 0 20rpx;position: fixed;bottom:0;width: 95%;left: 0;background-color:#fff;padding-bottom: 80rpx;z-index: 10000;padding-top: 20rpx;" v-if="btnShow">
				<view style="text-align:center;color: #fff;background-color: #3277fc;border-radius: 30rpx;padding: 16rpx 0;font-size: 28rpx;" @click='submit()'>提交报名</view>
			</view>
		</view>
		<!-- <u-popup v-model="showOpenSettingDialog" mode="center" width="520rpx" :mask-close-able="false" height="300rpx"
			border-radius="18">
			<div class="mock-dialog">
				<div class="mock-dialog-content">
					<div class="mock-dialog-title">提示</div>
					<div class="mock-dialog-text">
						{{tipsContent}}
					</div>
				</div>
				<div class="mock-dialog-button">
					<div class="color-gray" @click="dontOpenSetting">{{buttonCancelText}}</div>
					<div class="color-blue" @click="openSetting">{{buttonConfirmText}}</div>
				</div>
			</div>
		</u-popup> -->
	</view>
</template>

<script>
	import navbar from '@/components/baseNavbar.vue'
	import pxingPicker from '@/components/pxing-picker/pxing-picker.vue';
	import {
		getMakeDr,
		getMakeSj,
		getMakeTa,
		getMakeJg,
		getOrderSub,
		getInduList
	} from "@/api/make.js"
	import {
		getConfig,
		getGroupValue
	} from "@/api/public.js"
	import {
		goNav
	} from '@/lib/Comment.js'
	export default {
		components:{
			navbar,
			pxingPicker
		},
		data(){
			return{
				style:{
					backgroundColor:'#fff',
					padding:'6rpx 20rpx'
				},
				showOpenSettingDialog: false, // 授权询问弹框，uview
				proShow:false,
				leShow:false,
				teamLevel:'',
				uidImg:"",
				typeList:[],
				level:[
					[
						{text:'1'},
						{text:'2'},
						{text:'3'},
						{text:'4'},
						{text:'5'},
					]
				],
				proList:[[]],
				details:{},
				latitude:'',
				longitude:'',
				type:'',
				leim:'',
				id:'',
				btnShow:true,
				suid:'',
				darn:{
					name:'',
					phone:'',
					people:'',
					orderId:'',
					accountName:'',
					uuid:''
				},
				sj:{
					name:'',
					phone:'',
					people:'',
					orderId:'',
					official:'',
					brand:'',
					shop:'',
					shopId:'',
					cate:'',
					cateId:''
				},
				jg:{
					name:'',
					phone:'',
					people:'',
					official:'',
					orderId:'',
					mechanismName:''
				},
				tuan:{
					name:'',
					phone:'',
					people:'',
					orderId:'',
					official:'',
					cate:'',
					teamName:'',
					teamLevel:'',
					cateId:''
				}
			}
		},
		onShow(){
			console.log(this.typeList);
			if(this.typeList.length==0){
				getInduList().then(res=>{
					this.typeList = res.data
				})
				getOrderSub({id:this.id}).then(res=>{
					console.log('11',res);
					this.details = res.data
					let arr = [
						{
							text:'达人',
							type:0
						},{
							text:'商家',
							type:1
						},{
							text:'团长',
							type:2
						},{
							text:'机构',
							type:3
						}
					]
					
					res.data.type.forEach(item=>{
						let e = arr.find(s=>s.type==item)
						this.proList[0].push(e)
					})
					this.type = this.proList[0][0].text
				})
			}
		},
		onLoad(option) {
			if(option.suid){
				this.suid = option.suid
			}
			if(option.orderId){
				this.darn.orderId = option.orderId
				this.sj.orderId = option.orderId
				this.tuan.orderId = option.orderId
				this.jg.orderId = option.orderId
			}
			getConfig('uid_tip_image').then(res=>{
				this.uidImg = res.data.value
			})
			getInduList().then(res=>{
				this.typeList = res.data
			})
			if(option.Id){
				console.log('1',option.Id);
				this.id = option.Id
				getOrderSub({id:option.Id}).then(res=>{
					console.log('11',res);
					this.details = res.data
					let arr = [
						{
							text:'达人',
							type:0
						},{
							text:'商家',
							type:1
						},{
							text:'团长',
							type:2
						},{
							text:'机构',
							type:3
						}
					]
					
					
				})
			}
		},
		methods:{
			previewImg() {
				let imgsArray = [];
				imgsArray[0] = this.uidImg;
				uni.previewImage({
					current: 0,
					urls: imgsArray
				});
			},
			openMap(item){
				uni.getFuzzyLocation({
					type: 'gcj02',
					success: function (res) {
						console.log('模糊',res);
						this.latitude = res.latitude
						this.longitude = res.longitude
						uni.openLocation({
							latitude: this.latitude, //即将传到高德或腾讯地图的终点纬度  必须是数值，字符串无效
							longitude:this.longitude, //即将传到高德或腾讯地图的终点经度  必须是数值，字符串无效
							name: item.name, //即将传到高德或腾讯地图的店铺名称
							address: item.address, //即将传到高德或腾讯地图的详细地址
							scale: 18
						})
					},
				});
			 
			},
			getTypeShow(){
				this.$refs.pickerName.show();
				this.btnShow=false
			},
			Typeclose(){
				this.$refs.pickerName.hide();
				this.btnShow=true
			},
			colse(e){
				console.log('close',e);
				this.btnShow = true
			},
			Typeconfirm(e){
				console.log('xuanz1',e);
				
				let ty =''
				let id =''
				if(e.length!=0){
					ty = e[0].label
					id = e[0].value
					this.leim = ty
					if(this.type=='团长'){
						this.tuan.cate = ty
						this.tuan.cateId = id
						this.tuan.spreadUid = this.suid
					}else if(this.type == '商家'){
						this.sj.cate = ty
						this.sj.cateId = id
						this.sj.spreadUid = this.suid
					}else if(this.type == '达人'){
						this.darn.cate = ty
						this.darn.cateId = id
						this.darn.spreadUid = this.suid
					}else if(this.type == '机构'){
						this.jg.cate = ty
						this.jg.cateId = id
						this.jg.spreadUid = this.suid
					}
				}
				this.btnShow=true
			},
			goCard(url, appid) {
				if (appid) {
					uni.navigateToMiniProgram({
						appId: appid,
						path: url,
						envVersion: 'release'
					})
				} else {
					goNav(url)
				}
			
			},
			proConfirm(e){
				console.log('111',e);
				this.type = e.value[0].text
				this.proShow = false
			},
			leConfirm(e){
				console.log('111',e);
				this.tuan.teamLevel = e.value[0].text
				this.leShow = false
			},
			// 判断消息订阅总开关是否打开
			judgementMessageSwitch(flag) {
				let that = this
				uni.getSetting({
					withSubscriptions: true,
					success(res) {
						console.log(res)
						if (!res.subscriptionsSetting.mainSwitch) { // 订阅消息的总开关,如果是关着的，引导用户去打开
							that.showOpenSettingDialog = true
							uni.showToast({
								title:'您已经订阅了',
								icon:'none'
							})
							
						} else { // 如果开着，则继续向下打开弹窗，获取用户授权
							that.messageSubscription()
						}
			 
					},
					fail() {
						that.messageSubscription() // 如果失败，则继续向下打开弹窗，获取用户授权
						
					}
				})
			},
			 
			// 弹窗点订阅，开启消息订阅提醒
			openSetting() {
				if(this.buttonConfirmText == '确定'){
					this.messageSubscription()
					return
				}
				
				var that = this
				uni.openSetting({
					withSubscriptions: true,
					complete(res) {
						uni.getSetting({
							withSubscriptions: true,
							success(res) {
								if (res.subscriptionsSetting.mainSwitch) { // 订阅消息的总开关,如果是开着的
									that.tipsContent = '再次点击确定，弹出可订阅列表进行订阅'
									that.buttonCancelText = '取消'
									that.buttonConfirmText = '确定'
								} else {
									that.showOpenSettingDialog = false;
								}
							}
						})
					}
				})
			},
			 
			// 弹窗点不订阅
			dontOpenSetting() {
				this.showOpenSettingDialog = false;
				
			},
			 
			// 订阅申请弹出，只允许点击弹出
			messageSubscription() {
				this.tipsContent= '为了及时掌握订单状态，您是否想接收订单状态的消息提醒？' // 弹框提示内容，
				this.buttonConfirmText= '去开启消息提醒'
				this.buttonCancelText= '不需要提醒'
				let that = this
				that.showOpenSettingDialog = false;
				console.log('进入');
				let tmplId = ['hbOQIsGBM02DCQrYpfd3IFaZUYLlMADljzXJtrWOY5I','-WSgoEvem9SdvkW7Bh9DHXeX3Z94ACuEa1uwyAXxUyk','OBWrk5qx_HfKjUnEBR1TfpagBd4x0Lt2UaFVZBk4zlw'] // 模板ID，去小程序后台管理开一个，写进数组里，官方文档也有介绍
				uni.requestSubscribeMessage({
					tmplIds: tmplId,
					success(res) {
						console.log("success", res)
						if (res['hbOQIsGBM02DCQrYpfd3IFaZUYLlMADljzXJtrWOY5I','-WSgoEvem9SdvkW7Bh9DHXeX3Z94ACuEa1uwyAXxUyk','OBWrk5qx_HfKjUnEBR1TfpagBd4x0Lt2UaFVZBk4zlw'] == 'accept') {
							console.log('订阅成功');
							uni.showToast({
								title:'订阅成功',
								icon:'none'
							})
							
						}else if (res['hbOQIsGBM02DCQrYpfd3IFaZUYLlMADljzXJtrWOY5I','-WSgoEvem9SdvkW7Bh9DHXeX3Z94ACuEa1uwyAXxUyk','OBWrk5qx_HfKjUnEBR1TfpagBd4x0Lt2UaFVZBk4zlw']== "reject") {
							console.log('订阅失败');
							uni.showToast({
								title:'订阅失败',
								icon:'none'
							})
							
						}
					},
				})
			},
			submit(){
				if(this.type!=""){
					console.log('type',this.type);
					if(this.type=='达人'){
						getMakeDr(this.darn).then(res=>{
							console.log('11',res);
							if(res.code==200){
								uni.showToast({
									title:'提交成功',
									icon:'none'
								})
								this.darn = {}
								this.leim=''
							  this.judgementMessageSwitch()
							  setTimeout(()=>{
							  	uni.navigateTo({
							  		url:'/pages/sub/store/registration'
							  	})
							  },300)
							 
							}else if(res.code==500){
								uni.showToast({
									title:res.message,
									icon:'none'
								})
							}
						})
					} else if(this.type=='商家'){
						getMakeSj(this.sj).then(res=>{
							console.log('11',res);
							if(res.code==200){
								
								this.sj={}
								this.leim=''
							    this.judgementMessageSwitch()
								setTimeout(()=>{
									uni.navigateTo({
										url:'/pages/sub/store/registration'
									})
								},300)
								 
							}else if(res.code==500){
								uni.showToast({
									title:res.message,
									icon:'none'
								})
							}
						})
					}else if(this.type=='团长'){
						getMakeTa(this.tuan).then(res=>{
							console.log('11',res);
							if(res.code==200){
								
								this.tuan={}
								this.leim=''
							    this.judgementMessageSwitch()
								setTimeout(()=>{
									uni.navigateTo({
										url:'/pages/sub/store/registration'
									})
								},300)
								
							}else if(res.code==500){
								uni.showToast({
									title:res.message,
									icon:'none'
								})
							}
						})
				}else if(this.type=='机构'){
					console.log('机构');
						getMakeJg(this.jg).then(res=>{
							console.log('11',res);
							if(res.code==200){
								
								this.jg={}
								this.leim=''
							    this.judgementMessageSwitch()
								setTimeout(()=>{
									uni.navigateTo({
										url:'/pages/sub/store/registration'
									})
								},300)
							}else if(res.code==500){
								uni.showToast({
									title:res.message,
									icon:'none'
								})
							}
						})
					}else{
						uni.showToast({
							title:'请选择类型并填写报名',
							icon:'none'
						})
				}
				
			}
		}
	}
}
</script>
<style lang="scss">
	page{
		height: 100%;
		background-color:#f5f5f5;
	}
</style>
<style lang="scss" scoped>
	.conter{
	    padding: 20rpx;
	}
</style>